package me.zhengjie.modules.bushutongji.service;

import me.zhengjie.modules.bushutongji.domain.Bushutongji;
import me.zhengjie.modules.bushutongji.service.dto.BushutongjiDTO;
import me.zhengjie.modules.bushutongji.service.dto.BushutongjiQueryCriteria;
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
* @author xiexidong 
* @date 2019-07-24
*/
//@CacheConfig(cacheNames = "bushutongji")
public interface BushutongjiService {

    /**
    * queryAll 分页
    * @param criteria
    * @param pageable
    * @return
    */
    //@Cacheable(keyGenerator = "keyGenerator")
    Object queryAll(BushutongjiQueryCriteria criteria, Pageable pageable);

    /**
    * queryAll 不分页
    * @param criteria
    * @return
    */
    //@Cacheable(keyGenerator = "keyGenerator")
    public Object queryAll(BushutongjiQueryCriteria criteria);

    /**
     * findById
     * @param id
     * @return
     */
    //@Cacheable(key = "#p0")
    BushutongjiDTO findById(Integer id);

    /**
     * create
     * @param resources
     * @return
     */
    //@CacheEvict(allEntries = true)
    BushutongjiDTO create(Bushutongji resources);

    /**
     * update
     * @param resources
     */
    //@CacheEvict(allEntries = true)
    void update(Bushutongji resources);

    /**
     * delete
     * @param id
     */
    //@CacheEvict(allEntries = true)
    void delete(Integer id);

    /**
     * 查询所有单位  去重
     * @return
     */
    List<String> findDanwei();
}